package com.etl.dataflow.common.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Data
@ToString(exclude = "taskList")
@EqualsAndHashCode(exclude = "taskList")
public class ExecutorInfo {
    /**
     * 执行器的任务列表
     */
    private List<TaskInfo> taskList = Collections.synchronizedList(new ArrayList<>());
    @NotBlank
    private String host;
    @NotBlank
    private String port;
    @NotBlank
    private String uuid;

    public String getExecutorUrl() {
        return "http://" + this.host + ":" + this.port;
    }
}
